<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"+"user/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <base href="<%=basePath%>">
  
  <title>登录</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" href="../res/layui/css/layui.css">
  <link rel="stylesheet" href="../res/css/global.css">
  <script src="../res/layui/layui.js"></script>
  <script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
</head>
<body>

<div class="header">
  <div class="main">
    <a class="logo" href="../index.jsp" title="Fly">Fly社区</a>
    <div class="nav">
      <a class="nav-this" href="../index.jsp">
        <i class="iconfont icon-wenda"></i>问答
      </a>
    </div>
    
    <%-- <div class="nav-user">      
      <!-- 登入后的状态 -->
      
      <a class="avatar" href="home.jsp">
        <img src="../res/images/avatar/11.jpg">
        <cite>贤心</cite>
        <i>VIP</i>
      </a>
      <div class="nav">
        <a href="set.jsp"><i class="iconfont icon-shezhi"></i>设置</a>
        <a href="login.jsp"><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>退了</a>
      </div>
    </div> --%>
    
  </div>
</div>

<div class="main layui-clear">

  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief">
      <ul class="layui-tab-title">
        <li class="layui-this">登入</li>
        <li><a href="reg.jsp">注册</a></li>
      </ul>
      <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <div class="layui-form layui-form-pane">
            <!-- 表单 -->
            <form action="login" method="post">
              <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_email" name="userEmail"  lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_pass" name="userPwd"  lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_vercode" class="layui-form-label">人类验证</label>
                <div class="layui-input-inline">
                  <input type="text" id="code" name="code"  lay-verify="required" placeholder="请回答后面的问题" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid">
                  <!-- <span style="color: #c00;">1+1=?</span> -->
                </div>
                <div>
                  <!-- 这里图片的src已经不是一个固定图片地址，而是一个jsp文件 -->
                  <img src="ImageJsp.jsp" id="imgs" title="tupian" alt="tupian" width="60px" height="20px" /> &nbsp; &nbsp; <a
                    href="javascript:f_change()">换图片</a>
                  <script>
                    function f_change() {
                      //使用存的js获得img对象，使用jquery框架的 $(),好像不管用
                      var img = document.getElementById("imgs");
                      img.src = "ImageJsp.jsp?id=" + new Date().getTime();//通过id值的不同，让服务器不是缓存中的图片流，生成一个新的图片流
                    }
                  </script>
                </div>
              </div>
              <div class="layui-form-item">
                <input class="layui-btn" type="submit" value="登录">
              </div>
              <!-- 错误提示 -->
              <div class="checkbox mg-b25">
				<label>
					<c:if test="${LOGIN_MSG != null }">
						提示：<span class="login_msg" style="color: red">${LOGIN_MSG }</span>
					</c:if>
				</label>
			  </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>

</div>
	
	<div class="footer">
  <p><a href="#">QA社区</a> 2017 &copy; <a href="#/">QAFly.com</a></p>
  <p>
    <a href="#" target="_blank">产品授权</a>
    <a href="#" target="_blank">QA社区</a>
    <a href="#" target="_blank">微信公众号</a>
  </p>
</div>

<script>
		layui.use('element', function() {
			var element = layui.element();
		});
	</script>
<script>

layui.cache.page = '';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '../res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "2.0.0"
  ,base: '../res/mods/'
}).extend({
  fly: 'index'
}).use('fly');
</script>
</body>
</html>
